<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setAttribute("path", request.getContextPath());
%>
<script type="text/javascript">
function firstCatChange(obj,targetId){

	var catId = $(obj).val();
	if(catId){
		$.post("${root}/mst/pro/cat/children/item",{parentId:catId},function( opts ){
			$("#"+targetId).html(opts);
		});
	}
}

function initFirstCat(firstId,firstVal,secondId,secondVal,isAll){

	$("#"+firstId).val(firstVal);

	$.post("${root}/mst/pro/cat/children/item",{parentId:firstVal,isAll:isAll},function( opts ){
		$("#"+secondId).html(opts);
		$("#"+secondId).val(secondVal);
	});
}

function firstOrgChange(obj,targetId,isAll){
	var result = false;
	if(isAll == true){result = false;}
	
	var orgId = $(obj).val();
	if(orgId){
		$.post("${root}/mst/org/children/item",{parentId:orgId,isAll:result},function( opts ){
			$("#"+targetId).html(opts);
		});
	}
}

function initFirstOrg(firstId,firstVal,secondId,secondVal,isAll){

	$("#"+firstId).val(firstVal);

	$.post("${root}/mst/org/children/item",{parentId:firstVal,isAll:isAll},function( opts ){
		$("#"+secondId).html(opts);
		$("#"+secondId).val(secondVal);
	});
}

</script>